package common.rbac.po;

import javax.persistence.Embeddable;
//import javax.persistence.GeneratedValue;


@Embeddable
public class RoleAuthorityKey extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3752296122429303541L;
	private String authId;
	private String roleId;

	public String getAuthId() {
		return authId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setAuthId(String authId) {
		this.authId = authId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((authId == null) ? 0 : authId.hashCode());
		result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		RoleAuthorityKey other = (RoleAuthorityKey) obj;
		if (authId == null) {
			if (other.authId != null)
				return false;
		} else if (!authId.equals(other.authId))
			return false;
		if (roleId == null) {
			if (other.roleId != null)
				return false;
		} else if (!roleId.equals(other.roleId))
			return false;
		return true;
	}

}
